package com.atguigu.tingshu.album.mapper;

import com.atguigu.tingshu.model.album.TrackInfo;
import com.atguigu.tingshu.query.album.TrackInfoQuery;
import com.atguigu.tingshu.vo.album.AlbumTrackListVo;
import com.atguigu.tingshu.vo.album.TrackListVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface TrackInfoMapper extends BaseMapper<TrackInfo> {

    /**
     * 分页查询用户的声音数据
     * @param page
     * @param trackInfoQuery
     * @return
     */
    IPage<TrackListVo> selectUserTrackPage(Page<TrackListVo> page, @Param("query") TrackInfoQuery trackInfoQuery);

    /**
     * 根据专辑id和声音的orderNum修改该专辑之后的声音的orderNum
     * @param albumId
     * @param orderNum
     */
    void updateTrackNum(@Param("albumId") Long albumId,@Param("orderNum") Integer orderNum);

    /**
     * 获取专辑的声音列表
     * @param albumId
     * @param albumTrackListVoPage
     * @return
     */
    IPage<AlbumTrackListVo> selectAlbumTrackPage(@Param("albumId") Long albumId, Page<AlbumTrackListVo> albumTrackListVoPage);
}
